<?php
namespace Admin\Controller;
use Think\Controller;
class CommonController extends Controller {
    public function index(){
    	
        $this->show();
    }

  
  // 权限的初始化
    public function  _initialize(){
       $uid=$_SESSION['id'];
       $path=MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME;//访问路径
       if(!M('auth_rule')->where(array('name'=>$path))->find()){
          return;
       }else{
           $auth=new \Think\Auth();
           $res= $auth->check($path,$uid);
           if (!$res){
            $this->error('你没此权限',U('admin/index/welcome'));
            }
       };
    }

}//类的结尾